package org.terramagnet.resource.server;

import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.terramagnet.mvcframework.query.Query;
import org.terramagnet.mvcframework.query.QueryHolder;
import org.terramagnet.mvcframework.resource.ResourceService;

/**
 *
 * @author lip
 */
@Controller
public class DashboradController {

    @Resource
    private ResourceService resourceService;
    
    @Resource
    private QueryHolder queryHolder;

    @RequestMapping(path = "/resource", method = RequestMethod.POST)
    public String serach(@RequestParam MultiValueMap<String,String> params) {
        queryHolder.saveRequestParameters(getClass().getName(), params);
        return "redirect:/resource";
    }
    
    
    @RequestMapping(path = "/resource", method = RequestMethod.GET)
    public String resource(@RequestParam MultiValueMap<String,String> params) {
//        Query query = queryHolder.query(getClass().getName());
//        resourceService.
        return null;
    }
    
}
